﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using Kopytko.GameBase;

namespace Kopytko.BoardGame
{
    /// <summary>
    /// Klasa "Pionka" dziedziczy po niej pionek warcabowy, oraz figura szachowa
    /// </summary>
    public class Pawn : UserControl
    {
        private static int ids;
        static int Ids {get { return ++ids; }}

        private Grid _parentGrid;

        public Pawn()
        {
        }

        public Pawn(BoardPlayer player, BoardPosition position)
        {
            //_parentGrid = parentGrid;

            Player = player;
            X = position.X;
            Y = position.Y;
            State = PawnState.InGame;
        }

        // Id - jakies auto..
        public int Id { get;  protected set; }

        // Owner
        public BoardPlayer Player { get; protected set; }

        private byte x;
        private byte y;

        public byte X { get { return x; } set {x = value; Grid.SetColumn(this, x); }}
        public byte Y { get { return y; } set { y = value; Grid.SetRow(this, y); }}

        public PawnState State { get; set; }

    }

    public enum PawnState
    {
        InGame,
        Beated,   
    }
}
